﻿/*
[/filesystem/filesystem.js]
*/

Ext.namespace("tk","tk.yunos","tk.yunos.system");

tk.yunos.system.Linker = function(fileDescriptor){
	var file = fileDescriptor;
	if(file != null){
		tk.yunos.filesystem.getFileContent(file.address, function(success, fileContent){
			if(success){
				var linkObj = Ext.decode(fileContent);
				var linkedFile = {
					name: file.name,
					desc: file.desc,
					icon: file.icon,
					mime: linkObj.mime,
					address: linkObj.linkTo
				}
				tk.yunos.filesystem.openFile(linkedFile, linkObj.params);
			}
		});
	}
}
